import dataclasses


@dataclasses.dataclass  # alt+enter
class Girl:
    # def __init__(self):
    #     self.name = "tyy"
    #     self.age = 18
    age: int = 19
    name: str = "tyy"

    def show(self):
        print("began演习")

    def show2(self):
        print("began演习")
        print(f"我的年龄是{self.age}")

    @classmethod
    def show3(cls):
        print("..")
        print(f"我的年龄是{cls.age}")


girl = Girl(20)  # 当创建对象时，传递实参过去会覆盖属性值
print(girl.age)
print(girl.name)
girl.show3()
# # 使用替身代替演戏
#
# def func1():
#     print(girl.name)
#     girl.show()


# func1实例对象调用方法属性
# func1()
